#include <iostream>
#include <fstream>

using namespace std;

int main( int argc , char * argv[]){
    
    ifstream file;
    
    file.open( argv[1] );
    
    if (!file.is_open()) {
        cout << "error" << endl;
    }
    
    float temp1, temp2, temp3, temp4 = 0;
    float time, iteration = 0;
    int counter = 0;	    
    
    while (! file.eof()) {
        
        file >> temp1 >> temp2 >> temp3 >> temp4;
        
        time += temp1;
        iteration += temp2;
        
        counter++;
        
	if ( counter % 4 == 0) {
	
		cout << temp4 << "\t" <<  time / counter << endl;
		time = 0;
        counter = 0;

	}
        
    }
    
    file.close();
    
//    cout <<  "Average execution time : " << time / counter << endl;
//    cout <<  "Average iteration time : " << iteration / counter << endl;
    
    
}
